package test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class bbb {
	public static void main(String[] args) throws SQLException, ClassNotFoundException {
		Class.forName("com.mysql.jdbc.Driver");
		Connection con2=DriverManager.getConnection("jdbc:mysql://192.168.0.183:3306/sotu","root","root");
		PreparedStatement pst=con2.prepareStatement("update shoes_store set uukey=?,done=1 where uukey=?");
		con2.setAutoCommit(false);
		
		Connection con1=DAO.DbcpConnection.getConnection();
		Statement st1=con1.createStatement();
		ResultSet rs1=st1.executeQuery("select * from mapuukey");
		int i=0;
		while (rs1.next()) {
			System.out.println(i++);
			long uukeyfrom=rs1.getLong("uukeyfrom");
			long uukeyto=rs1.getLong("uukeyto");
			pst.setLong(1, uukeyto);
			pst.setLong(2, uukeyfrom);
			pst.execute();
		}
		con2.commit();
	}
}
